Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sandeepprasad_j
Creator
Creator

Help In Set Analysis Expression?

Hello Experts,

Can you please help me in writing the set analysis expression for the below if condition

If(vPer=12,sum([Amt]),(if(vPer=6, sum([Amt]))))

Thanks in advance

Cheers

Sandeep

12 Replies
tresesco
MVP
MVP

Your expression doesn't look very promising. Or, may be a set analysis would not help here much.

Could you explain the context? Is this expression being used in a chart (if yes, what are the dimensions?) or ..?

mightyqlikers
Creator III
Creator III

Hi Sandeep

use below expression

=Sum({<vPer={"6","12"}>}Amt)

Regards

Samwise

jyothish8807
Master II
Master II

Hi Sangeep,

Try like this:

sum({<vPer={'6','12'}>}[Amt])

Regards

KC

Best Regards,
KC
PrashantSangle

Hi,

Try like,

sum(if(vPer=12,Amt,if(vPer=6,Amt)))

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 🙂
sandeepprasad_j
Creator
Creator
Author

Thanks for all the replies but the expression is like

If(vPeriod=12,sum([ 12 Amt]),(if(vPeriod=6, sum([6 Amt]))))

Cheers ,

Sandeep.

PrashantSangle

Hi,

[12 Amt] and [6 Amt] is fieldName??

Try like

sum(if(vPer=12,[12 Amt],if(vPer=6,[6 Amt])))

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 🙂
sandeepprasad_j
Creator
Creator
Author

Hello Max,

Yes,those are field name [12 Amt] and [6 Amt]

and code like (001,002) is the dimension for the chart

sandeepprasad_j
Creator
Creator
Author

The dimension is the Code like 001,002 and the expressions is a above

If(vPeriod=12,sum([ 12 Amt]),(if(vPeriod=6, sum([6 Amt]))))

vperios is variable

[ 12 Amt] and [6 Amt] are the fields

PrashantSangle

Hi,

Then try the solution which i have given in my earlier post.

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 🙂