Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
apegahfar
New Contributor III

Help on Set analysis

Hi Community,

I am trying to use below function as expression in a straight table

=Count({<PeriodCode={$(=FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period)))-1)}>}Period)

but it doesnt work

however without '-1' it works

please help

regards

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Help on Set analysis

Try like:

=Count({<Period,PeriodCode={$(=FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period)))-1)}>}Period)

14 Replies
rahulpawarb
Valued Contributor III

Re: Help on Set analysis

May be this:

=Count({<PeriodCode={"$(=Num(FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period))))-1)"}>}Period)

Along with this, could you please check what below function is returning? This will help you to identify the root cause.

=FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period)))

Hope this will be helpful.

Regards!

Rahul Pawar

Re: Help on Set analysis

Let's assume

FieldIndex('Period', GetFieldSelections(Period)) -- 4 // Assuming, you are selecting 4th record from Period Table

FieldValue('PeriodCode', 4) -- ABC // May be 4th place of PeriodCode is ABC

Then how you need ABC - 1 ???

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
MVP
MVP

Re: Help on Set analysis

If you are looking for the earlier indexed value count of the field, you may try with a bracket correction like:

=Count({<PeriodCode={$(=FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period))-1))}>}Period)

apegahfar
New Contributor III

Re: Help on Set analysis

Dear Rahul Pawar

thank for your reply

unforetunately it didnt wotk

i checked (=FieldValue('PeriodCode',FieldIndex('Period',GetFieldSelections(Period))))

it works

regard

apegahfar
New Contributor III

Re: Help on Set analysis

Dear Anil Babu Samineni

thank for your reply

the Format of PeriodCode is number.  as a resault FieldValue('PeriodCode', 4) return number not string

i checked (FieldIndex('Period', GetFieldSelections(Period))-1 )

it works correctly

regard

apegahfar
New Contributor III

Re: Help on Set analysis

Dear Tresesco

thanks for your reply

i try that

it didnt work unfortunately

regard

Re: Help on Set analysis

Will you able to provide work file to test?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Re: Help on Set analysis

Can you provide sample apps???

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.

Re: Help on Set analysis

Can you add the expression to your table as a new column with no label.

Then if you hover over the column header you can see how the variables in your set expression are being evaluated, which may help identify the problem.