Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
jasmina_karcic
Creator III
Creator III

Dynamic values for x-axis

Hi everyone,

How can I make a date dimension for line chart, for dates I want show?


For example: Today is 26.6.


I want a line chart with x axis that has values for last 8 weeks:


8.5., 15.5., 22.5., 29.5., 5.6.,10.6., 19.6., 26.6.


But if I choose from filter for example date 19.6. I want x-axis with values:


2.5., 9.5., 16.5., 23.5., 30.5.,5.6., 12.6., 19.6.


Thanks,


Jasmina

2 Replies
Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

Hello Jasmina,

to create a Dimension for DATE  (last 60 days)

​In your loadscript:

for i=60 to 0 step -1

let date = date(today()-$(i));

LOAD * Inline [

DATE

$(date)

];

next



In your Charts:

To invert selected Values you must use set analysis in the measure like:

sum({1-$} Value)

but this only shows something if you have set a filter.

you can try something like that as measure to solve that

if(GetSelectedCount(DATE)=0,sum(Value), sum({1-$} Value))

imhappiee
Contributor III
Contributor III

Hi,

Hope this link helps

https://community.qlik.com/thread/91233

Anand