Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
apegahfar
Contributor III
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

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

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

View solution in original post

14 Replies
rahulpawarb
Specialist III
Specialist III

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

Anil_Babu_Samineni

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 ???

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

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
Contributor III
Contributor III
Author

Dear Rahul Pawar

thank for your reply

unforetunately it didnt wotk

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

it works

regard

apegahfar
Contributor III
Contributor III
Author

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
Contributor III
Contributor III
Author

Dear Tresesco

thanks for your reply

i try that

it didnt work unfortunately

regard

Anil_Babu_Samineni

Will you able to provide work file to test?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle

Can you provide sample apps???

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Colin-Albert

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.