Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Pomna
Creator III
Creator III

NPrinting Pivot Table

Hello experts I need your help with creating an NPrinting pivot table. Below is the code I have so far which gives me a straight table but I need it to be  a pivot table.

<!DOCTYPE html>
<html>
<head>
<style>
table, td,th {
border: 1px solid black;
}
</style>
</head>
<body>

<table>
<tr>
<th>Quarter</th>
<th>Position</th>
<th>Goal This Q</th>
<th>Apps This Q</th>
<th>Goal Met This Q</th>
<th>2020 Goal</th>
<th>2020 Apps for SMP</th>
<th>Percentage Goal Met</th>
<th>Number Accepted 2020</th>
<th>Accepted Percentage</th>

</tr>
<tr>
<td>%%Quarter%%</td>
<td>%%=[Role Group]%%</td>
<td>%%Sum({_Quarter={"$(vQuarter)"}_} Goals)%%</td>
<td>%%=COUNT({_Goals={"_0"},Year={'2020'},Quarter={"$(vQuarter)"}_}[Applicant ID])%%</td>
<td>%%Count({$_Goals={"_0"}, Year={'2020'}, Quarter={"$(vQuarter)"}_}[Applicant ID]) / Sum({$_[Applicant Submit Date]=,Quarter={"$(vQuarter)"}_} [Goals])%%</td>
<td>%%if($(vApplicationCount) _ 0 or $(vApplicationGoals) _0,Sum({$_[Applicant Submit Date]=,Year=, [Quarter]=_} [Goals]))%%</td>
<td>%%Count({$_Goals={"_0"},Year={'2020'},Quarter=_}[Applicant ID])%%</td>
<td>%%Count({$_Goals={"_0"},Year={'2020'},Quarter=_}[Applicant ID]) / if($(vApplicationCount) _ 0 or $(vApplicationGoals) _0,Sum({$_[Applicant Submit Date]=,Year=, [Quarter]=_} [Goals]))%% </td>
<td>%%Count({_[Current Status ID]={2}_}[Applicant ID])%%</td>
<td>%%Count({_[Current Status]={'Accepted'}_}[Applicant ID])/Count({$_Goals={"_0"},Year={'2020'},Quarter=_}[Applicant ID])%%</td>
</tr>
</table>

</body>
</html>

The output is a straight table which looks like this

Pomna_1-1604590771621.png

 

But I need a pivot table . Any suggestions will be appreciated.

 

Labels (2)
1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Pivot tables in HTML are not easy to build and whole code (in my opinion) must come from Qlik application directly

Example here: https://nprintingadventures.com/2020/04/24/how-to-build-html-pivot-table-in-nprinting/

btw... there is no one piece of code we can give you - it will be purely based on requirements so you may want to share mockup of final outcome identifying what is dynamic (number of grouped dimensions in rows and columns etc...)

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.