Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to only select values beloning to the specific month?

Hi,

In my application I'm using a Master Calendar which works just fine.

Now I've got an Excel sheet with values for every month and every quarter, live this:

NumberJanuaryFebruaryQ1
3.1250100200
3.2900100299
3.3400700400

This is for all the months of the year and for all quarters.

What I want to achieve is the following.

A bar chart where all the values are displayed for each month.

So basically the Month field from the calendar is the dimension. For each month it has to display the corresponding value from the sheet. How can I achieve this? The same applies for when I use Quarter as a dimension.

For example:

I want to create a bar chart like this (dont mind the red line).

So in stead of the values above, I get the following:

January: 250
Februari: 100

etc. etc.

Naamloos.png

Message was edited by: Nazeem Soeltan

Added excel sheet.

9 Replies
MK_QSL
MVP
MVP

Can you explain little more with an example please... Didn't understand from your question itself.. Thanks

Not applicable
Author

Hi i've added an example in the first post.

datagrrl
Creator III
Creator III

Not sure if I understand the requirement. Data Model wise I would turn this crosstab table into a longer table.

The data is much easier to work with like this:

Number
MonthValue
3.1Jan250
3.2Jan900
3.3Jan400
3.1Feb100
3.2Feb100
3.3Feb700

Do the monthly numbers not aggregate to the quarter numbers?

If that is the case you might want to change the month column to a Time Period Column.

I am not the best modeler, but this is how I would approach it, it just seems easier to consume in QV to me.

Not applicable
Author

That seems a good solution. Any idea how I can make this in the script?

I've added the QVW file in the first post. The table: KPI contains the excel import.

The Master Calendar is to be found in Kalender table.

datagrrl
Creator III
Creator III

CT1.PNG

This is the third screen of the table wizard. There you select CrossTable.

After you hit next you need to fill it out like this:

I use this a lot for Excel files my users give me, because having a dimension across the columns is pretty common in Excel. Your measures need to be at the end, but they usually are.

CT2.PNG

The Table looks like this:

CT3.PNG

Not applicable
Author

Wow, thank you so much!

Do you know how to make the link between the fields from the Master Calendar?

For example, if I use Calendar.Month, that only Jan - Dec is selected?

datagrrl
Creator III
Creator III

Since the quarters aren't cumulative, I am not 100% sure how I would set that up.

I could get you to the months by changnig the column name. I would probably do some manipulation and maybe create either a second table for the Quarter KPIS or a field IDing the other Periods.

It is a little sloppy, but I think you could do:

Number, Month, Quarter, Year, Value

Then just have null values for the attributes you aren't using.


Not applicable
Author

I'm sorry do you have an example, as this isn't my strongest point..
But your solution seems reasonable.

CrossTable(KPI.Tijdsperiode, KPI.Waarde, 6)
LOAD Perceel as KPI.Perceel,
      Nummer as KPI.Nummer,
      Omschrijving as KPI.Omschrijving,
      [Norm per jaar] as [KPI.Norm per jaar],
      [Norm per kwartaal] as [KPI.Norm per kwartaal],
      [Norm per maand] as [KPI.Norm per maand],
      Jan,
      Feb,
      Mrt,
      Apr,
      Mei,
      Juni,
      Juli,
      Aug,
      Sept,
      Okt,
      Nov,
      Dec,
      Q1,
      Q2,
      Q3,
      Q4
FROM

(ooxml, embedded labels, table is [Normen en vaste waardes]);

THis is what i've got.

KPI.Tijdsperiode = TimePeriod.

KPI.Waarde = Value.

datagrrl
Creator III
Creator III

I attached a version of what I am suggesting. It is really sloppy, and I am not 100% sure it will work.

You could also do something similar and create a second table. Someone else might suggest something more standard data model wise, I think mine might not be perfect.

Good luck. I won't be back for a few days.