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: 
Anonymous
Not applicable

merging 3 expression into one expression

Hello all,

I am three expression say:

RollingMonth as a dimension

PreviousMonth_CurrentYear =sum({<RollingMonth={'$(=VPM)'}>} SalesAmount)

CurrentMonth_CurrentYear =sum({<RollingMonth={'$(=VCM)'}>} SalesAmount)

CurrentMonth_PreviousYear =sum({<RollingMonth={'$(=VCM)'}>} SalesAmount)


where as variable are


VPM= =MonthName(AddMonths(max(SalesDate),-1))


VCM= =MonthName(max(SalesDate))


VCMLY= MonthName(AddMonths(max(SalesDate),-12))


Can I merge these 3 expression into 1 expression by using Pick,Match,WildMatch function etc.


Regards,

Balraj


27 Replies
teiswamsler
Partner - Creator III
Partner - Creator III

Hi Balraj

I dont know if my solution is the most elligant but it works.

look in qvw to maybe find som inspiration

/Teis !

sunny_talwar

See if this expression helps:

=Sum({<RollingMonth={'$(=VPM)', '$(=VCM)', '$(=VCMLY)'}, Month = , Year = >} Sales)

Output With no selection:

Capture.PNG

With Year and Month Selection:

Capture.PNG

Is this close to what you want?

sunny_talwar

Hey Balraj,

Is this still not what you are looking for? If not can you explain what exactly are you looking to do?

Anonymous
Not applicable
Author

I tried with bypassing the things like you shared. But did not work.

Let me try again

Anonymous
Not applicable
Author

Simple words,

I want CM Vs PM vs CMLY in single expression like IN statement in SQL

and it should work on all the selections

sunny_talwar

In three different columns? or three different rows comparison?

Right now I see three different row comparison between the three dates?

Anonymous
Not applicable
Author

Got it. I was missing to bypass SalesMonth.

Let me implement in live enviornment.

sunny_talwar

Awesome

Let us know if you continue to have trouble.

Best,

Sunny