Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
PrajS
Contributor III
Contributor III

Swap between 2 date fields on x axis on toggle

I created a line chart that displays the Date value  Vs Order Revenue . 

Date value depends on the toggle 1 or 2 , Toggle 1 Order date and if selected Toggle 2 Order shipped Date

 

I have created a variable selectiontype, and i have described it in my measure . 

I am not able to implement it in my x axis/ dimenion. 

 

i need something like below in dimension expression

if selectiontype=1, Month([Order date]), Month([Shipped Date])

 

Pls let me know

Thank you 

Labels (4)
3 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

assuming your expression is the same for both date 

than the easy way will be 

to create the order data as one dimension 

and add the order shipped date as alternative dimension then the user can switch between them using qlik sense native capability 

PrajS
Contributor III
Contributor III
Author

Thank you. But I already have toggle and few more charts abv which are
displayed based on toggle selection . Hence user wants to use the same
toggle

PrajS
Contributor III
Contributor III
Author

Strange thing is 

 

When I use if(vSelectionType=1, Month(OrderDate]), Month([Shipped Date]) in the Dimension expression directly- first criteria works doesnt work for second .

 

But When I create a new dimension using above expression, it works for second criteria that is vSelectionType=2 and not when it is 1.

 

I want it to work on both cases.

Any help is appreciated.

Thank you