Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Force dimension into X-axis

Hi,

i have two dimensions and a count(num), but i want to force one of the dimensions, period, into the X-axis (see screen attached). When i change the order of the dimensions, the y-axis switches position with the period.

The period, as a column, it's not linked directly with a date calendar, but there's a date linked in both (calendar and period) tables. What i want to show is the period, and not the date linked.


Not sure if of any help for the purpose, but my master calendar looks like the below:

source_dataset_counter has the period and date which is linked with the master calendar

examples:
period='2018_M01' , which is what i want to see in the x-axis
date_period='2018-01-01'

LET varMinDate = NUM(PEEK('date_period',0,'source_dataset_counter'));

LET varMaxDate = NUM(PEEK('date_period',-1,'source_dataset_counter'));

TempCalendar: 

LOAD 

$(varMinDate) + Iterno()-1 As Num, 

Date($(varMinDate) + IterNo() - 1) as TempDate 

AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 

// Create the Master Calendar

MasterCalendar:

LOAD

Date(TempDate, 'YYYY-MM-DD') AS Date,

WEEK(TempDate) AS Week,

YEAR(TempDate) AS Year,

NUM(MONTH(TempDate),'00') AS Month,

YEAR(TempDate)&'_'&'D'& DayNumberOfYear(TempDate) AS Day,

YEAR(TempDate)&'_'&'M'& NUM(MONTH(TempDate),'00') AS YearMonth,

'Q' & CEIL(MONTH(TempDate)/3)&'_'&YEAR(TempDate) AS QuarterYear,

YEAR(TempDate)&'_'&'W'& WEEK(TempDate) AS YearWeek,

WEEKDAY(TempDate) AS WeekDay

RESIDENT TempCalendar

Order BY TempDate ASC;

DROP Table TempCalendar;

Thank You so much,

Regards,

0 Replies